\(\int (d+e x)^2 (a+b \arctan (c x)) \, dx\) [3]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 16, antiderivative size = 103 \[ \int (d+e x)^2 (a+b \arctan (c x)) \, dx=-\frac {b d e x}{c}-\frac {b e^2 x^2}{6 c}-\frac {b d \left (d^2-\frac {3 e^2}{c^2}\right ) \arctan (c x)}{3 e}+\frac {(d+e x)^3 (a+b \arctan (c x))}{3 e}-\frac {b \left (3 c^2 d^2-e^2\right ) \log \left (1+c^2 x^2\right )}{6 c^3} \]

[Out]

-b*d*e*x/c-1/6*b*e^2*x^2/c-1/3*b*d*(d^2-3*e^2/c^2)*arctan(c*x)/e+1/3*(e*x+d)^3*(a+b*arctan(c*x))/e-1/6*b*(3*c^
2*d^2-e^2)*ln(c^2*x^2+1)/c^3

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {4972, 716, 649, 209, 266} \[ \int (d+e x)^2 (a+b \arctan (c x)) \, dx=\frac {(d+e x)^3 (a+b \arctan (c x))}{3 e}-\frac {b d \arctan (c x) \left (d^2-\frac {3 e^2}{c^2}\right )}{3 e}-\frac {b \left (3 c^2 d^2-e^2\right ) \log \left (c^2 x^2+1\right )}{6 c^3}-\frac {b d e x}{c}-\frac {b e^2 x^2}{6 c} \]

[In]

Int[(d + e*x)^2*(a + b*ArcTan[c*x]),x]

[Out]

-((b*d*e*x)/c) - (b*e^2*x^2)/(6*c) - (b*d*(d^2 - (3*e^2)/c^2)*ArcTan[c*x])/(3*e) + ((d + e*x)^3*(a + b*ArcTan[
c*x]))/(3*e) - (b*(3*c^2*d^2 - e^2)*Log[1 + c^2*x^2])/(6*c^3)

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 266

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 649

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[(-a)*c]

Rule 716

Int[((d_) + (e_.)*(x_))^(m_)/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[PolynomialDivide[(d + e*x)^m, a + c*x^2,
x], x] /; FreeQ[{a, c, d, e}, x] && NeQ[c*d^2 + a*e^2, 0] && IGtQ[m, 1] && (NeQ[d, 0] || GtQ[m, 2])

Rule 4972

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((d_) + (e_.)*(x_))^(q_.), x_Symbol] :> Simp[(d + e*x)^(q + 1)*((a + b*
ArcTan[c*x])/(e*(q + 1))), x] - Dist[b*(c/(e*(q + 1))), Int[(d + e*x)^(q + 1)/(1 + c^2*x^2), x], x] /; FreeQ[{
a, b, c, d, e, q}, x] && NeQ[q, -1]

Rubi steps \begin{align*} \text {integral}& = \frac {(d+e x)^3 (a+b \arctan (c x))}{3 e}-\frac {(b c) \int \frac {(d+e x)^3}{1+c^2 x^2} \, dx}{3 e} \\ & = \frac {(d+e x)^3 (a+b \arctan (c x))}{3 e}-\frac {(b c) \int \left (\frac {3 d e^2}{c^2}+\frac {e^3 x}{c^2}+\frac {c^2 d^3-3 d e^2+e \left (3 c^2 d^2-e^2\right ) x}{c^2 \left (1+c^2 x^2\right )}\right ) \, dx}{3 e} \\ & = -\frac {b d e x}{c}-\frac {b e^2 x^2}{6 c}+\frac {(d+e x)^3 (a+b \arctan (c x))}{3 e}-\frac {b \int \frac {c^2 d^3-3 d e^2+e \left (3 c^2 d^2-e^2\right ) x}{1+c^2 x^2} \, dx}{3 c e} \\ & = -\frac {b d e x}{c}-\frac {b e^2 x^2}{6 c}+\frac {(d+e x)^3 (a+b \arctan (c x))}{3 e}-\frac {1}{3} \left (b d \left (\frac {c d^2}{e}-\frac {3 e}{c}\right )\right ) \int \frac {1}{1+c^2 x^2} \, dx-\frac {\left (b \left (3 c^2 d^2-e^2\right )\right ) \int \frac {x}{1+c^2 x^2} \, dx}{3 c} \\ & = -\frac {b d e x}{c}-\frac {b e^2 x^2}{6 c}-\frac {b d \left (d^2-\frac {3 e^2}{c^2}\right ) \arctan (c x)}{3 e}+\frac {(d+e x)^3 (a+b \arctan (c x))}{3 e}-\frac {b \left (3 c^2 d^2-e^2\right ) \log \left (1+c^2 x^2\right )}{6 c^3} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.40 (sec) , antiderivative size = 163, normalized size of antiderivative = 1.58 \[ \int (d+e x)^2 (a+b \arctan (c x)) \, dx=\frac {(d+e x)^3 (a+b \arctan (c x))-\frac {b \left (c^2 e^2 x (6 d+e x)+\left (-e^2 \left (3 \sqrt {-c^2} d+e\right )+c^2 d^2 \left (\sqrt {-c^2} d+3 e\right )\right ) \log \left (1-\sqrt {-c^2} x\right )-\left (c^2 d^2 \left (\sqrt {-c^2} d-3 e\right )+e^2 \left (-3 \sqrt {-c^2} d+e\right )\right ) \log \left (1+\sqrt {-c^2} x\right )\right )}{2 c^3}}{3 e} \]

[In]

Integrate[(d + e*x)^2*(a + b*ArcTan[c*x]),x]

[Out]

((d + e*x)^3*(a + b*ArcTan[c*x]) - (b*(c^2*e^2*x*(6*d + e*x) + (-(e^2*(3*Sqrt[-c^2]*d + e)) + c^2*d^2*(Sqrt[-c
^2]*d + 3*e))*Log[1 - Sqrt[-c^2]*x] - (c^2*d^2*(Sqrt[-c^2]*d - 3*e) + e^2*(-3*Sqrt[-c^2]*d + e))*Log[1 + Sqrt[
-c^2]*x]))/(2*c^3))/(3*e)

Maple [A] (verified)

Time = 1.22 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.16

method result size
parts \(\frac {a \left (e x +d \right )^{3}}{3 e}+\frac {b \,e^{2} \arctan \left (c x \right ) x^{3}}{3}+b e \arctan \left (c x \right ) x^{2} d +b \arctan \left (c x \right ) x \,d^{2}-\frac {b \,e^{2} x^{2}}{6 c}-\frac {b d e x}{c}-\frac {b \,d^{2} \ln \left (c^{2} x^{2}+1\right )}{2 c}+\frac {e^{2} b \ln \left (c^{2} x^{2}+1\right )}{6 c^{3}}+\frac {e b d \arctan \left (c x \right )}{c^{2}}\) \(119\)
derivativedivides \(\frac {\frac {a \left (c e x +c d \right )^{3}}{3 c^{2} e}+b \arctan \left (c x \right ) d^{2} c x +b c e \arctan \left (c x \right ) d \,x^{2}+\frac {b c \,e^{2} \arctan \left (c x \right ) x^{3}}{3}-b e d x -\frac {b \,e^{2} x^{2}}{6}-\frac {b \ln \left (c^{2} x^{2}+1\right ) d^{2}}{2}+\frac {b \,e^{2} \ln \left (c^{2} x^{2}+1\right )}{6 c^{2}}+\frac {b e \arctan \left (c x \right ) d}{c}}{c}\) \(123\)
default \(\frac {\frac {a \left (c e x +c d \right )^{3}}{3 c^{2} e}+b \arctan \left (c x \right ) d^{2} c x +b c e \arctan \left (c x \right ) d \,x^{2}+\frac {b c \,e^{2} \arctan \left (c x \right ) x^{3}}{3}-b e d x -\frac {b \,e^{2} x^{2}}{6}-\frac {b \ln \left (c^{2} x^{2}+1\right ) d^{2}}{2}+\frac {b \,e^{2} \ln \left (c^{2} x^{2}+1\right )}{6 c^{2}}+\frac {b e \arctan \left (c x \right ) d}{c}}{c}\) \(123\)
parallelrisch \(-\frac {-2 x^{3} \arctan \left (c x \right ) b \,c^{3} e^{2}-2 x^{3} a \,c^{3} e^{2}-6 x^{2} \arctan \left (c x \right ) b \,c^{3} d e -6 x^{2} a \,c^{3} d e -6 x \arctan \left (c x \right ) b \,c^{3} d^{2}+x^{2} b \,c^{2} e^{2}-6 a \,c^{3} d^{2} x +3 \ln \left (c^{2} x^{2}+1\right ) b \,c^{2} d^{2}+6 x b \,c^{2} d e -6 \arctan \left (c x \right ) b c d e -\ln \left (c^{2} x^{2}+1\right ) b \,e^{2}}{6 c^{3}}\) \(150\)
risch \(-\frac {i \left (e x +d \right )^{3} b \ln \left (i c x +1\right )}{6 e}+a d e \,x^{2}+x \,d^{2} a -\frac {b d e x}{c}+\frac {x^{3} e^{2} a}{3}-\frac {b \,e^{2} x^{2}}{6 c}+\frac {i e b d \,x^{2} \ln \left (-i c x +1\right )}{2}+\frac {i b \,d^{2} x \ln \left (-i c x +1\right )}{2}-\frac {b \,d^{2} \ln \left (c^{2} x^{2}+1\right )}{2 c}+\frac {e b d \arctan \left (c x \right )}{c^{2}}+\frac {i b \,d^{3} \ln \left (c^{2} x^{2}+1\right )}{12 e}-\frac {b \,d^{3} \arctan \left (c x \right )}{6 e}+\frac {e^{2} b \ln \left (c^{2} x^{2}+1\right )}{6 c^{3}}+\frac {i e^{2} b \,x^{3} \ln \left (-i c x +1\right )}{6}\) \(200\)

[In]

int((e*x+d)^2*(a+b*arctan(c*x)),x,method=_RETURNVERBOSE)

[Out]

1/3*a*(e*x+d)^3/e+1/3*b*e^2*arctan(c*x)*x^3+b*e*arctan(c*x)*x^2*d+b*arctan(c*x)*x*d^2-1/6*b*e^2*x^2/c-b*d*e*x/
c-1/2/c*b*d^2*ln(c^2*x^2+1)+1/6/c^3*e^2*b*ln(c^2*x^2+1)+1/c^2*e*b*d*arctan(c*x)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 133, normalized size of antiderivative = 1.29 \[ \int (d+e x)^2 (a+b \arctan (c x)) \, dx=\frac {2 \, a c^{3} e^{2} x^{3} + {\left (6 \, a c^{3} d e - b c^{2} e^{2}\right )} x^{2} + 6 \, {\left (a c^{3} d^{2} - b c^{2} d e\right )} x + 2 \, {\left (b c^{3} e^{2} x^{3} + 3 \, b c^{3} d e x^{2} + 3 \, b c^{3} d^{2} x + 3 \, b c d e\right )} \arctan \left (c x\right ) - {\left (3 \, b c^{2} d^{2} - b e^{2}\right )} \log \left (c^{2} x^{2} + 1\right )}{6 \, c^{3}} \]

[In]

integrate((e*x+d)^2*(a+b*arctan(c*x)),x, algorithm="fricas")

[Out]

1/6*(2*a*c^3*e^2*x^3 + (6*a*c^3*d*e - b*c^2*e^2)*x^2 + 6*(a*c^3*d^2 - b*c^2*d*e)*x + 2*(b*c^3*e^2*x^3 + 3*b*c^
3*d*e*x^2 + 3*b*c^3*d^2*x + 3*b*c*d*e)*arctan(c*x) - (3*b*c^2*d^2 - b*e^2)*log(c^2*x^2 + 1))/c^3

Sympy [A] (verification not implemented)

Time = 0.32 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.55 \[ \int (d+e x)^2 (a+b \arctan (c x)) \, dx=\begin {cases} a d^{2} x + a d e x^{2} + \frac {a e^{2} x^{3}}{3} + b d^{2} x \operatorname {atan}{\left (c x \right )} + b d e x^{2} \operatorname {atan}{\left (c x \right )} + \frac {b e^{2} x^{3} \operatorname {atan}{\left (c x \right )}}{3} - \frac {b d^{2} \log {\left (x^{2} + \frac {1}{c^{2}} \right )}}{2 c} - \frac {b d e x}{c} - \frac {b e^{2} x^{2}}{6 c} + \frac {b d e \operatorname {atan}{\left (c x \right )}}{c^{2}} + \frac {b e^{2} \log {\left (x^{2} + \frac {1}{c^{2}} \right )}}{6 c^{3}} & \text {for}\: c \neq 0 \\a \left (d^{2} x + d e x^{2} + \frac {e^{2} x^{3}}{3}\right ) & \text {otherwise} \end {cases} \]

[In]

integrate((e*x+d)**2*(a+b*atan(c*x)),x)

[Out]

Piecewise((a*d**2*x + a*d*e*x**2 + a*e**2*x**3/3 + b*d**2*x*atan(c*x) + b*d*e*x**2*atan(c*x) + b*e**2*x**3*ata
n(c*x)/3 - b*d**2*log(x**2 + c**(-2))/(2*c) - b*d*e*x/c - b*e**2*x**2/(6*c) + b*d*e*atan(c*x)/c**2 + b*e**2*lo
g(x**2 + c**(-2))/(6*c**3), Ne(c, 0)), (a*(d**2*x + d*e*x**2 + e**2*x**3/3), True))

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.22 \[ \int (d+e x)^2 (a+b \arctan (c x)) \, dx=\frac {1}{3} \, a e^{2} x^{3} + a d e x^{2} + {\left (x^{2} \arctan \left (c x\right ) - c {\left (\frac {x}{c^{2}} - \frac {\arctan \left (c x\right )}{c^{3}}\right )}\right )} b d e + \frac {1}{6} \, {\left (2 \, x^{3} \arctan \left (c x\right ) - c {\left (\frac {x^{2}}{c^{2}} - \frac {\log \left (c^{2} x^{2} + 1\right )}{c^{4}}\right )}\right )} b e^{2} + a d^{2} x + \frac {{\left (2 \, c x \arctan \left (c x\right ) - \log \left (c^{2} x^{2} + 1\right )\right )} b d^{2}}{2 \, c} \]

[In]

integrate((e*x+d)^2*(a+b*arctan(c*x)),x, algorithm="maxima")

[Out]

1/3*a*e^2*x^3 + a*d*e*x^2 + (x^2*arctan(c*x) - c*(x/c^2 - arctan(c*x)/c^3))*b*d*e + 1/6*(2*x^3*arctan(c*x) - c
*(x^2/c^2 - log(c^2*x^2 + 1)/c^4))*b*e^2 + a*d^2*x + 1/2*(2*c*x*arctan(c*x) - log(c^2*x^2 + 1))*b*d^2/c

Giac [F]

\[ \int (d+e x)^2 (a+b \arctan (c x)) \, dx=\int { {\left (e x + d\right )}^{2} {\left (b \arctan \left (c x\right ) + a\right )} \,d x } \]

[In]

integrate((e*x+d)^2*(a+b*arctan(c*x)),x, algorithm="giac")

[Out]

sage0*x

Mupad [B] (verification not implemented)

Time = 0.38 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.23 \[ \int (d+e x)^2 (a+b \arctan (c x)) \, dx=\frac {a\,e^2\,x^3}{3}+a\,d^2\,x-\frac {b\,d^2\,\ln \left (c^2\,x^2+1\right )}{2\,c}+\frac {b\,e^2\,\ln \left (c^2\,x^2+1\right )}{6\,c^3}-\frac {b\,e^2\,x^2}{6\,c}+a\,d\,e\,x^2+b\,d^2\,x\,\mathrm {atan}\left (c\,x\right )+\frac {b\,e^2\,x^3\,\mathrm {atan}\left (c\,x\right )}{3}-\frac {b\,d\,e\,x}{c}+\frac {b\,d\,e\,\mathrm {atan}\left (c\,x\right )}{c^2}+b\,d\,e\,x^2\,\mathrm {atan}\left (c\,x\right ) \]

[In]

int((a + b*atan(c*x))*(d + e*x)^2,x)

[Out]

(a*e^2*x^3)/3 + a*d^2*x - (b*d^2*log(c^2*x^2 + 1))/(2*c) + (b*e^2*log(c^2*x^2 + 1))/(6*c^3) - (b*e^2*x^2)/(6*c
) + a*d*e*x^2 + b*d^2*x*atan(c*x) + (b*e^2*x^3*atan(c*x))/3 - (b*d*e*x)/c + (b*d*e*atan(c*x))/c^2 + b*d*e*x^2*
atan(c*x)